package main

import (
	"SimpleRouter/Util"
	"SimpleRouter/router"
	"fmt"
	"github.com/gin-gonic/gin"
	"os"
)

func main() {
	dir, err := os.Getwd()
	if err != nil {
		panic(err)
	}
	path := dir + "/config.json"

	config := Util.ReadJson(path)
	//println(config)
	fmt.Println(config.Server.Address)
	r := gin.Default()
	router.InitRouter(r)
	r.Run(config.Server.Address + ":" + config.Server.Port)
}
